{temp('html/recruit/pc/head')}
<script charset="utf-8" src="{$adstyle}/editor/kindeditor.js"></script>
<script charset="utf-8" src="{$adstyle}/editor/lang/zh_CN.js"></script>
<script type="text/javascript" src="../liaot/static/jquery.js"  media="all"></script>
	<script type="text/javascript" src="../liaot/static/jquery.websocket.js"  media="all"></script>
   	<script type="text/javascript">
		WS_STATIC_URL = '{$_url}/websocket/static';
		WS_HOST = '120.27.199.74';
		WS_PORT = 7272;
		
	</script>
	<script>
		KindEditor.ready(function(K) {
			//var editor = K.create('#chat');
			window.editor=K.create('#chat',{items:['fontname','fontsize','|','forecolor','bold','italic','underline',
			    '|','emoticons','image']		
			 });
		});
		function ltlx(type){
			$.post('{$_url}/?act=job&met=ltlx',{type:type},function(data){
	    		alert(data);
	    		if(type == 2){
	    			location.href='{$_url}/?act=job&met=liaot';
	    		}else{
	    			location.href='{$_url}/?act=job&met=liaot{if(@$did)}&uid={$did}{/if}';
	    		}	    		
	    	});
		}
		
		function xuer(uid){
			location.href='{$_url}/?act=job&met=liaot&uid='+uid;
		}
		

		var base64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
		var base64DecodeChars = new Array(
		　　-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		　　-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
		　　-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
		　　52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
		　　-1,　0,　1,　2,　3,  4,　5,　6,　7,　8,　9, 10, 11, 12, 13, 14,
		　　15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
		　　-1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
		　　41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
		function base64encode(str) {
		　　var out, i, len;
		　　var c1, c2, c3;
		　　len = str.length;
		　　i = 0;
		　　out = "";
		　　while(i < len) {
		 c1 = str.charCodeAt(i++) & 0xff;
		 if(i == len)
		 {
		　　 out += base64EncodeChars.charAt(c1 >> 2);
		　　 out += base64EncodeChars.charAt((c1 & 0x3) << 4);
		　　 out += "==";
		　　 break;
		 }
		 c2 = str.charCodeAt(i++);
		 if(i == len)
		 {
		　　 out += base64EncodeChars.charAt(c1 >> 2);
		　　 out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
		　　 out += base64EncodeChars.charAt((c2 & 0xF) << 2);
		　　 out += "=";
		　　 break;
		 }
		 c3 = str.charCodeAt(i++);
		 out += base64EncodeChars.charAt(c1 >> 2);
		 out += base64EncodeChars.charAt(((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4));
		 out += base64EncodeChars.charAt(((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6));
		 out += base64EncodeChars.charAt(c3 & 0x3F);
		　　}
		　　return out;
		}
		
		function utf16to8(str) {
			　　var out, i, len, c;
			　　out = "";
			　　len = str.length;
			　　for(i = 0; i < len; i++) {
			 c = str.charCodeAt(i);
			 if ((c >= 0x0001) && (c <= 0x007F)) {
			　　 out += str.charAt(i);
			 } else if (c > 0x07FF) {
			　　 out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
			　　 out += String.fromCharCode(0x80 | ((c >>　6) & 0x3F));
			　　 out += String.fromCharCode(0x80 | ((c >>　0) & 0x3F));
			 } else {
			　　 out += String.fromCharCode(0xC0 | ((c >>　6) & 0x1F));
			　　 out += String.fromCharCode(0x80 | ((c >>　0) & 0x3F));
			 }
			　　}
			　　return out;
			}
		
		function utf16to8(str) {
			　　var out, i, len, c;
			　　out = "";
			　　len = str.length;
			　　for(i = 0; i < len; i++) {
			 c = str.charCodeAt(i);
			 if ((c >= 0x0001) && (c <= 0x007F)) {
			　　 out += str.charAt(i);
			 } else if (c > 0x07FF) {
			　　 out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
			　　 out += String.fromCharCode(0x80 | ((c >>　6) & 0x3F));
			　　 out += String.fromCharCode(0x80 | ((c >>　0) & 0x3F));
			 } else {
			　　 out += String.fromCharCode(0xC0 | ((c >>　6) & 0x1F));
			　　 out += String.fromCharCode(0x80 | ((c >>　0) & 0x3F));
			 }
			　　}
			　　return out;
			}
	</script>
	<script>
	 $(function () {   //返回   
		 window.onload=function(){
			$.wssend('{"type":"relogin","uid":"'+{$kid}+'"}');
		 } 
 
		$('#fasong').click(function(){
			editor.sync();
			var nn = $("#chat").val();
			if(nn){
				var nr= base64encode(utf16to8(nn));
				{if(@$did)}
					var did = {$did};
				{else}
					var did = '';
				{/if}
				$.wssend('{"type":"talk","content":"'+nr+'","to_client_id":"'+did+'","uid":"'+{$kid}+'"}');
				document.getElementById( 'jilu').scrollTop=document.getElementById( 'jilu').scrollHeight;
			}else{
				alert('请输入内容');
			}
			return false;
		 });	 
	  });
	</script>
</head>
<body class="liaotian t_c">
	<!--主体内容-->
	<div class="w_850 auto_0" style="margin-top:5%;">
		<!--左侧-->
		<div class="f_l liaotian_zuo t_l">
			
			<!--头像-->
			<div class="liaotian_toubg t_m25 l_m22">
				<img src="{if(@$zjzl['touxiang'])}{photo({$zjzl['touxiang']})}{else}{$style}/images/temp/geren_136.png{/if}" class="t_m5 l_m5" width="136px" height="136px">
			</div>
			<!--头像结束-->
			<!--专家资料-->
			<div class="w_bai t_m10 t_c f_s12 c_000">
				<p>{if(@$zjzl['yname'])} {$zjzl['yname']}{/if}</p>
				<p class="t_m5">{if(@$_SESSION['zclx']==1)}{if(@$zjzl['qyname'])}{$zjzl['qyname']}签约专家{/if}{/if} </p>
			</div>
			<!--专家资料结束-->
			{if(@$zjid)}
			<!--选项-->
			<div class="w_bai t_m20">
				<!--一对一-->
				<div class="dis_inline liaotian_btn l_h25 l_m25 point">
					<div class="f_l l_m5" style="margin-top:7px!important;margin-top:5px">
						<img src="{$style}/images/liaotian/msg.png">
					</div>
					<div class="f_l l_m4 f_s12 c_FFF" onclick="ltlx('1')">一对一</div>
				</div>
				<!--一对一结束-->
				<!--一对多-->
				<div class="dis_inline liaotian_btn l_h25 l_m5 point">
					<div class="f_l l_m5" style="margin-top:7px!important;margin-top:5px">
						<img src="{$style}/images/liaotian/msg.png">
					</div>
					<div class="f_l l_m4 f_s12 c_FFF" onclick="ltlx('2')">一对多</div>
				</div>
				<!--一对多结束-->
			</div>
			<!--选项结束-->
			<div class="w_bai t_m10 f_s12 c_000" id="moshi">
				<p class="l_m20">当前模式：{if($user['ltlx'] == 1)}一对一{else}一对多{/if}</p>
			</div>
			{if(@$user['ltlx'] == 1)}
			<div class="w_bai t_m10  f_s12 c_000">
				<p class="f_l l_m20">选择聊天对象</p>
				<div class="f_l w_145 h_198 l_m20 t_m10 l_h21"  style="overflow-y:auto;max-height:190px;">
					{if(@$rlb)}
					{foreach($rlb as $k=>$v)}
					{if($v['uid'] != $zjid)}
					<p id="liaotianren" class="c_127ABF" onclick="xuer({$v['uid']})">{$v['uname']}</p>
					{/if}
					{/foreach}
					{/if}
				 </div>
			</div>
			{/if}
			{/if}
		</div>
		<!--左侧结束-->
		<!--右侧-->
		<div class="f_l liaotian_you t_l">
			<!--标题-->
			<div class="w_bai l_h50 dis_inline">
				<div class="f_l l_m20 t_m5 c_FFF">{if(@$user['ltlx'] == 2)}专家{$zjzl['yname']}的聊天室{else}{if(@$uid)}与专家-{$zjzl['yname']}的对话{else}{if(@$did)}与-{$dzl['yname']}的对话(在聊天过过程中也可能收到其他用户的私聊请求){else}请选择对话{/if}{/if}{/if}</div>
			</div>
			<!--标题结束-->
			<!--内容-->
			<div class="w_bai dis_inline">
				<!--左侧-->
				<div class="f_l w_460">
					<!--聊天框-->
					<div id="jilu" class="w_460 h_325" style="margin-top:7px;overflow-y:auto;max-height:325px;">

					</div>
					<!--聊天框结束-->
				
					<!--发送内容-->
					<div class="w_460 h_100">
						<div>
							<textarea id="chat" name="chat" style="width:458px;overflow: hidden; word-wrap: break-word; resize: horizontal; height: 80px;" class="form-control autogrow" data-validate="minlength[10]" rows="5" placeholder="">

							</textarea>
						</div>
					</div>
					<!--发送内容结束-->
				</div>
				<!--左侧结束-->
				<!--右侧-->
				<div class="f_r w_145 r_m10">
					<div class="w_145 h_395">
					{if(@$uid)}
					<!--头像-->
					<div class="liaotian_toubg t_m3" style="_margin-left:6px">
						<img src="{if(@$yhzl['touxiang'])}{photo({$yhzl['touxiang']})}{else}{$style}/images/temp/geren_136.png{/if}" class=" l_m5" width="136px" height="136px">
					</div>
					<!--头像结束-->
					<!--个人资料-->
					<div class="w_bai t_m15 l_m5 f_s12 c_FFF">
						<p>{if(@$yhzl['name'])}{$yhzl['name']}{/if}</p>
						<p class="t_m5">{if(@$yhzl['byyx'])}{$yhzl['byyx']}{/if}</p>
						<p class="t_m5">{if(@$yhzl['zy_name'])}{$yhzl['zy_name']}{/if}</p>
					</div>
					<!--个人资料结束-->
					{else}
						{if(@$user['ltlx'] == 2)}
						<!--头像-->
						<div class="liaotian_toubg" style="_margin-left:6px">
							<img src="{if(@$yhzl['touxiang'])}{photo({$yhzl['touxiang']})}{else}{$style}/images/temp/geren_136.png{/if}" class="t_m5 l_m5" width="136px" height="136px">
						</div>
						<!--头像结束-->
						<!--个人资料-->
						<div class="w_bai t_m15 l_m5 f_s12 c_FFF">
							<p>{$zjzl['yname']}专家聊天室</p>
						</div>
						<!--个人资料结束-->
						{else}
							{if(@$did)}
							<!--头像-->
							<div class="liaotian_toubg " style="_margin-left:6px">
								<img src="{if(@$dzl['touxiang'])}{photo({$dzl['touxiang']})}{else}{$style}/images/temp/tou_136.png{/if}" class="t_m5 l_m5" width="136px" height="136px">
							</div>
							<!--头像结束-->
							<!--个人资料-->
							<div class="w_bai t_m15 l_m5 f_s12 c_FFF">
								<p>{if(@$dzl['name'])}{$dzl['name']}{/if}</p>
								<p class="t_m5">{if(@$dzl['byyx'])}{$dzl['byyx']}{/if}</p>
								<p class="t_m5">{if(@$dzl['zy_name'])}{$dzl['zy_name']}{/if}</p>
							</div>
							<!--个人资料结束-->
							{/if}
						{/if}
					{/if}
					</div>
					<!--确认按钮-->
					<div style="float:left;margin-left:10px" id="fasong">
						<div class="w_100 h_35 l_h35  bc_127ABF c_FFF t_c point">
									发送
						</div>
					</div>
					<!--确认按钮结束-->
				</div>
				<!--右侧结束-->
			</div>
			<!--内容结束-->
		</div>
		<!--右侧结束-->
	</div>
	<!--主体内容结束-->
</body>
</html>